package com.gyp.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author xia
 * @Description: 华为云异常相关枚举
 * @date 2022/12/28
 */
@Getter
@AllArgsConstructor
public enum HwExceptionEnum {

    MODE_NAME_REPEAT("MSS.20030021", "模型名称重复"),

    TOKEN_MUST_UPDATE("APIGW.0307","token过期,请尝试重试")

    ;

    private String code;

    private String msg;

    public static HwExceptionEnum getValue(String code){
        HwExceptionEnum[] values = HwExceptionEnum.values();
        for (int i = 0; i < values.length; i++) {
            HwExceptionEnum value = values[i];
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }

}
